package com.demo.fileput;import java.io.File;import java.io.FileInputStream;import java.io.InputStream;import java.io.OutputStream;import java.net.Socket;public class Client {    public static void main(String[] args) throws Exception {        Socket s = new Socket("127.0.0.1",8899);        File file = new File("/Users/aa/DownLoads/ideaIU.dmg");        FileInputStream fis = new FileInputStream(file);        InputStream is = s.getInputStream();        OutputStream os = s.getOutputStream();        os.write(file.getName().getBytes());        byte[] bs = new byte[1024];        int len;        len = is.read(bs);        int success = Integer.parseInt(new String(bs,0,len));        if(success == 200) {            while ((len = fis.read(bs)) != -1) {                os.write(bs, 0, len);            }        }else{            System.out.println("文件错误");        }        s.close();    }}